import {Injectable} from '@angular/core';
import {Headers, RequestOptions} from '@angular/http';
import {HttpService} from '../../lib/service/http.service';
import {adSystemApiUrl} from '../../../config/api';

@Injectable()
export class DashService {

  constructor(private httpService: HttpService) {

  }

  // 获取小程序统计
  getAppletData() {
    const url = `${adSystemApiUrl}/v1/admin/overview_data/applet_data`;
    return this.httpService.httpGetAuth(url).map(rs => rs);
  }

  // 获取小程序月统计
  getAppletMonthData() {
    const url = `${adSystemApiUrl}/v1/admin/overview_data/applet_month_data`;
    return this.httpService.httpGetAuth(url).map(rs => rs);
  }

  // 用户统计
  getMemberData() {
    const url = `${adSystemApiUrl}/v1/admin/overview_data/member_data`;
    return this.httpService.httpGetAuth(url).map(rs => rs);
  }

  // 用户月统计
  getMemberMonthData() {
    const url = `${adSystemApiUrl}/v1/admin/overview_data/member_month_data`;
    return this.httpService.httpGetAuth(url).map(rs => rs);
  }
}
